#pragma once

#include "../DefinesCore.hpp"
#include <string>
#include <vector>

CYBERTRON_BEGIN

class UtilString
{
public:
	CybertronCoreAPI static std::wstring u2w(const std::string &us);
	CybertronCoreAPI static std::string w2u(const std::wstring &ws);
	CybertronCoreAPI static void split(
		std::vector<std::string>& parts,
		const std::string& input,
		char separator);

	CybertronCoreAPI static std::string toUpperCase(const std::string &str);
	CybertronCoreAPI static std::string toLowerCase(const std::string &str);
	CybertronCoreAPI static bool isEqual(
		const std::string& lhs,
		const std::string& rhs,
		bool ignoreCase = false);
	// 解析以lz4压缩，并以base64编码的字符串
	CybertronCoreAPI static bool decodeBase64Lz4Str(
		const std::string& intput,
		std::string& output);
	// 以lz4压缩，并以base64编码
	CybertronCoreAPI static bool encodeBase64Lz4Str(
		const std::string& intput,
		std::string& output);
	CybertronCoreAPI static std::string encodeBase64Str(const std::string& intput);
	CybertronCoreAPI static std::string decodeBase64Str(const std::string& intput);
};

CYBERTRON_END
